import React from 'react';
import pubsub from "pubsub-js";

const Children = () => {
    return (
        <div>
            <h4>函数组件 ==> 孙组件</h4>
            <button onClick={() => {
                pubsub.publish('two', 'Children == 孙组件');
            }}>孙组件修改count ==>
            </button>
            <button onClick={() => {
                pubsub.unsubscribe('two')
            }}>停止监听修改
            </button>
        </div>
    );
};

export default Children;